<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Encore\Admin\Config\Config;
use Illuminate\Support\Facades\Blade;
class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        //Config::load();
        //共享菜单数据
        //view()->share('menu', \App\Models\Index::menu());
        //自定义指令
        Blade::directive('Shao', function($id){
            $list = '';
            return '<?php unset($list); $list = \App\Models\Index::shao("'.$id.'");?>';
        });
        Blade::directive('ShaoList', function($class_id){
            $pageList = '';
            return '<?php unset($pageList); $pageList = \App\Models\Index::shao_list("'.$class_id.'");?>';
        });
        Blade::directive('ShaoModel', function($name){
            $model = '';
            return '<?php unset($model); $model = \App\Models\Index::shao_model("'.$name.'");?>';
        });
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
